<template>
  <div id="customer-analysis"></div>
</template>

<script setup>
import { onMounted } from 'vue';
import * as echarts from 'echarts';

const initChart = () => {
  const chartDom = document.getElementById('customer-analysis');
  const myChart = echarts.init(chartDom);
  const option = {
    color: ['#5470C6', '#91CC75', '#EE6666', '#FAC858', '#73C0DE', '#3BA272', '#FC8452', '#9A60B4', '#EA7CCC'],
    title: {
      text: '客户群体分析'
    },
    tooltip: {},
    radar: {
      indicator: [
        { name: '年轻人', max: 100 },
        { name: '中年人', max: 100 },
        { name: '老年人', max: 100 },
        { name: '学生', max: 100 },
        { name: '上班族', max: 100 }
      ]
    },
    series: [{
      name: '客户群体',
      type: 'radar',
      data: [
        {
          value: [80, 70, 60, 90, 85],
          name: '群体分布'
        }
      ]
    }]
  };

  myChart.setOption(option);
};

onMounted(() => {
  initChart();
});
</script>

<style scoped>
#customer-analysis {
  width: 100%;
  height: 100%;
}
</style> 